package com.woniu.apiImpl;

import com.woniu.api.HisRegisterQueryApi;
import com.woniu.dto.HisRegisterDto;
import com.woniu.dto.PageDTO;
import com.woniu.param.*;
import com.woniu.service.HisRegisterService;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;


@RestController
public class HisRegisterQueryApiImpl implements HisRegisterQueryApi {
    @Resource
    private HisRegisterService hisRegisterService;
    @Override
    public Result<HisRegisterDto> newRegistration(AddHisRegisterParam addHisRegisterParam) {
        HisRegisterDto hisRegisterDto = hisRegisterService.newRegistration(addHisRegisterParam);
        return Result.bulid(hisRegisterDto);
    }

    @Override
    public Result<PageDTO<HisRegisterDto>> pastRegistration(PastRegistrationParam pastRegistrationParamtientId) {
        PageDTO<HisRegisterDto> hisRegisterDtoPageDTO = hisRegisterService.patientPastRegistration(pastRegistrationParamtientId);

        return Result.bulid(hisRegisterDtoPageDTO);
    }

    @Override
    public Result<PageDTO<HisRegisterDto>> registerToday(TodayRegisterParam todayRegisterParam) {
        PageDTO<HisRegisterDto> hisRegisterDtoPageDTO = hisRegisterService.registerToday(todayRegisterParam);

        return Result.bulid(hisRegisterDtoPageDTO);
    }

    @Override
    public Result<PageDTO<HisRegisterDto>> registerMessage(ListHisRegisterParam listHisRegisterParam) {
        PageDTO<HisRegisterDto> hisRegisterDtoPageDTO = hisRegisterService.queryRegistration(listHisRegisterParam);
        return Result.bulid(hisRegisterDtoPageDTO);
    }

    @Override
    public Result<Boolean> deleteRegistration(ArrayList<Integer> patientId) {
        Boolean aBoolean = hisRegisterService.deleteRegistration(patientId);
        return Result.bulid(aBoolean);
    }

    @Override
    public Result<HisRegisterDto> modifyRegistrationStatus(Integer registerId, Integer registerStatus) {
        HisRegisterDto hisRegisterDto = hisRegisterService.modifyRegistrationStatus(registerId, registerStatus);
        return Result.bulid(hisRegisterDto);
    }

    @Override
    public Result<HisRegisterDto> modifyRegistration(ModifyHisRegisterParam modifyHisRegisterParam) {
        HisRegisterDto hisRegisterDto = hisRegisterService.modifyRegistration(modifyHisRegisterParam);
        return Result.bulid(hisRegisterDto);
    }
}
